
import { Entity, PrimaryUuid, MemberId, CreateDate, DateTime, Remark, Code, CouponLogStatus, CardId, CardUseTo, Digdit, AddressDetail } from '@sker/core'

@Entity({ name: 'card_log', comment: '会员卡记录' })
export class CardLog {
    @PrimaryUuid({
        primaryKeyConstraintName: "PK_CARD_LOG_ID"
    })
    id!: string;

    @Code({ comment: '卡号，仅实体卡有', nullable: true, default: '' })
    code!: string;

    @Code({ comment: '口令', nullable: true, default: '' })
    password!: string;

    @Digdit({ default: 1, nullable: true })
    count: number;

    @MemberId({ nullable: true, comment: '领卡人' })
    member_id!: string;

    @CardId({ comment: '所属卡', nullable: true })
    card_id!: string;

    @CouponLogStatus({ comment: '状态', nullable: true })
    status: string;

    @Remark({ comment: '备注', nullable: true })
    remark: string;

    @CardUseTo({ comment: '使用场景', nullable: true })
    use_to: string;

    @DateTime({ comment: '过期时间', nullable: true })
    expired_date: Date;

    @Code({comment: '运单号', nullable: true})
    transn: string;

    @AddressDetail({ nullable: true, default: {}, comment: '收货地址' })
    address_detail: any;

    @DateTime({ comment: '最后时间', nullable: true })
    last_use_date: Date;

    @CreateDate({ comment: '创建时间', nullable: true })
    create_date: Date;
}
